﻿using System;
using System.Windows;
using System.Windows.Controls;
using ThePresenter.Polls.Data;


namespace ThePresenter.Windows.Controls.Polls
{
	public class QuestionControl : UserControl
	{
		#region Dependency property identifiers
		/// <summary>
		/// Identifies the <see cref="ThePresenter.Windows.Controls.Polls.QuestionControl"/>.QuestionData property.
		/// </summary>
		public static readonly DependencyProperty QuestionDataProperty = DependencyProperty.Register("QuestionData", typeof(QuestionData), typeof(QuestionControl));
		#endregion


		#region Properties
		/// <summary>
		/// Gets or sets the question data. This is a dependency property.
		/// </summary>
		/// <value>The question data.</value>
		public QuestionData QuestionData
		{
			get { return (QuestionData)GetValue(QuestionDataProperty); }
			set { SetValue(QuestionDataProperty, value); }
		}
		#endregion


		#region Constructors
		/// <summary>
		/// Initializes a new instance of the <see cref="QuestionControl"/> class.
		/// </summary>
		public QuestionControl()
		{
			// HACK Resource dictionary loaded manually, because WPF does't allow inheritance in XAML.

			Resources.BeginInit();
			Resources.Source = new Uri(@"pack://application:,,,/Windows/Controls/Polls/Styles.xaml", UriKind.Absolute);
			Resources.EndInit();
		}
		#endregion
	}
}
